﻿using UnityEngine;
using System.Collections;

partial class LuaService
{
    //不建议用法，存在GC
    public void FireEvent(params object[] eventParams)
    {
        if (null == mFireEvent)
        {
            return;
        }
        //UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Call(eventParams);
        //UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1>(T1 arg1)
    {
        if (null == mFireEvent)
        {
            return;
        }
        //UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1>(arg1);
        //UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1, T2>(T1 arg1, T2 arg2)
    {
        if (null == mFireEvent)
        {
            return;
        }
        // UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1, T2>(arg1, arg2);
        //  UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3)
    {
        if (null == mFireEvent)
        {
            return;
        }
        // UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1, T2, T3>(arg1, arg2, arg3);
        //  UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1, T2, T3, T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
    {
        if (null == mFireEvent)
        {
            return;
        }
        //  UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1, T2, T3, T4>(arg1, arg2, arg3, arg4);
        //  UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1, T2, T3, T4, T5>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
    {
        if (null == mFireEvent)
        {
            return;
        }
        // UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1, T2, T3, T4, T5>(arg1, arg2, arg3, arg4, arg5);
        //UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1, T2, T3, T4, T5, T6>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
    {
        if (null == mFireEvent)
        {
            return;
        }
        // UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1, T2, T3, T4, T5, T6>(arg1, arg2, arg3, arg4, arg5, arg6);
        //  UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1, T2, T3, T4, T5, T6, T7>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
    {
        if (null == mFireEvent)
        {
            return;
        }
        //  UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1, T2, T3, T4, T5, T6, T7>(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
        //  UnityEngine.Profiling.Profiler.EndSample();
    }

    public void FireEvent<T1, T2, T3, T4, T5, T6, T7, T8>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
    {
        if (null == mFireEvent)
        {
            return;
        }
        // UnityEngine.Profiling.Profiler.BeginSample("LuaScript FireEvent");
        mFireEvent.Action<T1, T2, T3, T4, T5, T6, T7, T8>(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
        //  UnityEngine.Profiling.Profiler.EndSample();
    }

}
